<?php

class BrandModel extends BaseModel {

	public function getBrandName($id){
		if($id==false){
			return "";
		}
		$sql = "select brand_name from ecs_brand where brand_id=".$id;

		$brand_name = $this->db->getOne($sql);

		return $brand_name;
	}
	public function getBrandList($default_id=0){
		$sql = "select brand_id, brand_name from ecs_brand ";
		
		$list = $this->db->getAll($sql);
		if($default_id){
			foreach($list as $key=>$val){
				if($val["brand_id"] == $default_id){
					$list[$key]["isred"] = 1;
				}else{
					$list[$key]["isred"] = 0;
				}
			}
		}
		return $list;
	}	
}